//页面初始化
$(function(){
	//关闭新增窗口
	$("#closeBtn").click(function() {
		backendCommon.closeWin("noPassWin");
	});
});

//打开审核拒绝窗口
function openNoPassWin(id) {
	//初始化窗口
	$("#appId").val(id);
	backendCommon.formReset("noPassForm");
	backendCommon.openeWin('noPassWin');
	$("#saveBtn").unbind('click').click(function() {
		verifyNo();
	});
}

// 审核通过
function verifyPass(id){
	var param = {
			'id':id,
			'rn':Math.random()
	};
	$.post(mainDomain+'/info/infoPublishVerify/infoPublishVerifyPass.action', param, function(result){
		if (result.success && result.state == 1) {
			alert('操作成功');
			window.close();
		} else {
			$.messager.alert('提示', result.message, 'error');
		}
	});
}

// 审核拒绝
function verifyNo(){
	var id = $('#appId').val();
	var remark = $('#remark').val().trim();
	if(remark == ''){
		$.messager.alert('提示', '回复意见不能为空', 'error');
		return false;
	}
	if(remark.length > 250){
		$.messager.alert('提示', '回复意见不能操作250个长度', 'error');
		return false;
	}
	var param = {
			'id':id,
			'remark':remark,
			'rn':Math.random()
	};
	$.post(mainDomain+'/info/infoPublishVerify/infoPublishVerifyNoPass.action', param, function(result){
		if (result.success && result.state == 1) {
			alert('操作成功');
			window.close();
		} else {
			$.messager.alert('提示', result.message, 'error');
		}
	});
}

function intoInfoDetailPage(id){
	window.open(mainDomain+'/article/infoDetailPage/'+id+'.action');  
}

 